package com.eos.control.action.goods;

import com.eos.business.service.SysDeliverReceiptBusinessService;
import com.eos.common.tool.ConstantTool;
import com.eos.control.action.base.AbstractBaseAction;
import com.eos.orm.mybatis.model.ReceiptList;

public class UpdateBillOfSignAction extends AbstractBaseAction {
	private static final long serialVersionUID = 8797205063231532545L;
	private Integer billOfSignId;
	private String receiptListDesc;

	public void setBillOfSignId(Integer billOfSignId) {
		this.billOfSignId = billOfSignId;
	}

	public void setReceiptListDesc(String receiptListDesc) {
		this.receiptListDesc = receiptListDesc;
	}

	@Override
	public String execute() {
		try {
			if (null == billOfSignId || billOfSignId.intValue() <= 0) {
				statusCode = "300";
				message = "参数错误, 删除签收清单数据失败!";
			} else {
				SysDeliverReceiptBusinessService sdbs = new SysDeliverReceiptBusinessService();
				ReceiptList receipt = new ReceiptList();
				receipt.setId(billOfSignId);
				receipt.setReceiptDesc(receiptListDesc);
				receipt.setStatus(ConstantTool.STATUS_FAIL);
				String exeStatus = sdbs.updateReceiptListPKSelectivce(receipt);
				if ("SUCCESS".equals(exeStatus)) {
					statusCode = "200";
					message = "删除签收单数据成功!";
				} else {
					statusCode = "300";
					message = "系统繁忙, 删除签收单数据失败!";
				}
			}
		} catch (Exception e) {
			e.printStackTrace();
			statusCode = "300";
			message = "系统异常, 删除签收单数据失败!";
		}
		return SUCCESS;
	}
}
